package com.lightboat.common.core.domain.bo;

import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.SchemaProperty;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "物流打印")
public class LogisticsPrintBo implements Serializable {


    /**
     * 打印模板编码
     */
    @SchemaProperty(name = "打印模板编码")
    @NotBlank
    private String templateCode;

    /**
     * 操作人
     */
    @SchemaProperty(name = "操作人")
    private String operator;

    /**
     * 打印数据集合
     */
    @SchemaProperty(name = "打印数据集合")
    @NotNull
    @Valid
    private List<LogisticsPrintDataBo> printDatas;

    /**
     * 打印接口地址
     */
    @SchemaProperty(name = "打印接口地址")
    private List<String> urls;


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Schema(title = "物流打印数据")
    public static class LogisticsPrintDataBo {
        /**
         * 业务单号
         */
        @SchemaProperty(name = "业务单号")
        @NotBlank
        private String orderNumber;

        /**
         * 物流公司编码
         */
        @SchemaProperty(name = "物流公司编码")
        @NotBlank
        private String carrierCode;

        /**
         * 物流单号
         */
        @SchemaProperty(name = "物流单号")
        @NotBlank
        private String billCodeValue;

        /**
         * 物流单号类型，枚举值：waybillCode —运单号；packageCode—包裹号；boxCode—箱号
         */
        @NotBlank
        @SchemaProperty(name = "物流单号类型，枚举值：waybillCode —运单号；packageCode—包裹号；boxCode—箱号")
        private String billCodeType;

        /**
         * 打印场景,枚举值：4—京东快递/三方快递 ；5—京东快运；6—京东大件
         */
        @NotNull
        @SchemaProperty(name = "打印场景,枚举值：4—京东快递/三方快递 ；5—京东快运；6—京东大件")
        private Integer scene;
    }
}
